1. Field of the Invention
The present invention relates to a handshaking circuit for a network of interconnected nodes for establishing a particular relationship, such as parent-child relationship, between adjacent nodes by resolving a contention therebetween which occurs on a transmission medium, such as serial bus, when they simultaneously assert the same protocol status.
2. Description of the Related Art
A handshaking protocol is standardized by the IEEE Computer Society for interconnecting nodes such as personal computers and associated electronic devices through their ports using a serial bus known as IEEE 1394. According to the IEEE 1394 standard, adjacent nodes first establish a parent-child relationship by having one of the nodes assert itself as a xe2x80x9cchildxe2x80x9d of the other. In response, the other node recognizes itself as the parent of the child node and sends an acknowledgment. However, if the parent node has already asserted itself as a child node immediately before it recognizes the parenthood, a contention (collision) is said to occur between them. When both nodes detect this contention, they relinquish their assertion and wait a random period before making a second attempt.
However, the maximum random period is not sufficient to cover a bus length longer than the standard length of 4.5 meters. If the length of a serial bus is much longer than the standard length, there are instances where the contention cannot be resolved.
One solution to this problem would be to increase the time difference between the short and long random period values. Since the node is held in an inactive state during the time its random period timer is still counting clock, the use of a large fixed random value would result in an unnecessarily long interval to resolve a contention on short-length serial buses.
It is therefore an object of the present invention to provide a method of determining status of nodes regardless of the length of the transmission medium interconnecting the nodes.
According to a first aspect of the present invention, there is provided a handshaking circuit for establishing a particular relationship between nodes interconnected by a transmission medium. The handshaking circuit comprises a state detector for monitoring the transmission medium to detect a predetermined first state, a predetermined second state, a contention when the predetermined first states are simultaneously asserted on the transmission medium, and an idle state when either of the first and second states is not asserted on the transmission medium. A state machine is connected to the state detector for asserting the first state on the transmission medium to initiate a handshaking process and relinquishing the first state when the contention is detected by the state detector. A receive counter is connected to the state detector for continuously incrementing a receive count value from the instant the contention is detected to the instant the idle state is detected. A transmit counter is connected to the state detector and the state machine for continuously incrementing a transmit count value from the instant the first state is asserted to the instant the contention is detected. The receive count value is compared with the transmit count value. When the transmit count value is greater than the receive count value, the state machine asserts the first state on the transmission medium again and when the transmit count value is smaller than the receive count value, it asserts the second state on the transmission medium.
According to a second aspect, the present invention provides a handshaking circuit for establishing a particular relationship between nodes interconnected by a transmission medium. The handshaking circuit comprises a state detector for monitoring the transmission medium to detect a predetermined first state, a predetermined second state, a contention when the predetermined first states are simultaneously asserted on the transmission medium and an idle state when either of the first and second states is not asserted on the transmission medium. A state machine is connected to the state detector for asserting the first state on the transmission medium to initiate a handshaking process and relinquishing the first state when the contention is detected by the state detector. A receive counter is connected to the state detector for continuously incrementing a receive count value from the instant the contention is detected to the instant the idle state is detected. A transmit counter is connected to the state detector and the state machine for continuously incrementing a transmit count value from the instant the first state is asserted to the instant the contention is detected. A decision circuit produces a first decision output when the transmit and receive count values are lower than a predefined threshold and a second decision output when one of the transmit and receive count values is greater than the predefined threshold. A random period timer is activated in response to the detection of the contention by the state detector. The state machine is arranged to respond to the first decision output for asserting the first state on the transmission medium if the random period timer expires during the absence of the first and second states on the transmission medium and asserting the second state on the transmission medium if the random period timer expires during the presence of the first state on the transmission medium. The state machine responds to the second decision output for asserting the first state on the transmission medium when the transmit count value is greater than the receive count value and asserting the second state on the transmission medium when the transmit count value is smaller than the receive count value.
According to a first aspect of the present invention, there is provided a method of determining status of first and second nodes interconnected by a transmission medium, comprising the steps of (a) transmitting, from the first and second nodes, first and second request signals, respectively, to the transmission medium for asserting a parent state defined by the IEEE 1394 standard; and (b) setting the first node in the parent state and setting the second node in a child state defined by the IEEE 1394 standard, when the time of transmission of the first request signal is earlier than the time of transmission of the second request signal, and setting the first node in the child state and setting the second node in the parent state, when the time of transmission of the first request signal is later than the time of transmission of the second request signal.
According to a third aspect, the present invention provides a method of determining status of first and second nodes interconnected by a transmission medium, comprising the steps of (a) transmitting, from the first and second nodes, first and second request signals, respectively, to the transmission medium for asserting a first state, and (b) setting the first node in the first state and setting the second node in a second state, depending on the time of transmission of the first request signal relative to the time of transmission of the second request signal.
According to a fourth aspect, the present invention provides a method of determining status of local and remote nodes interconnected by a transmission medium, comprising the steps of (a) transmitting, from the local node, a first request signal to the transmission medium for asserting a first state, (b) causing a transmit counter in the local node to start incrementing a count value thereof in response to the transmission of the first request signal, (c) canceling the first request signal if a contention occurs on the transmission medium between the first request signal and a second request signal transmitted from the remote node, causing the transmit counter to stop incrementing the count value thereof, and causing a receive counter in the local node to start increment a count value thereof, and (d) causing the receive counter to stop incrementing the count value thereof when an idle state is detected on the transmission medium and setting the local node in the first state or in a second state depending on the count value of the transmit counter relative to the count value of the receive counter.